﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Synergy
{
    public partial class FormLingdao : Form
    {
        public FormLingdao()
        {
            InitializeComponent();
        }

        private void textBoxPass_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)
            {
                string sql;
                string yh;
                string mm;
                yh = this.textBoxTm.Text.Trim().Replace("-", "");
                mm = this.textBoxPass.Text.Trim().Replace("-", "");
                sql = "select * from Z_UA_User where cUser_Id='" + yh + "' and  cpassword='" + mm + "'";
                DataTable tb = pub.SysGetTable(sql);
                if (tb.Rows.Count > 0)
                {
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    this.DialogResult = DialogResult.No;
                }
            }
        }

        private void FormLingdao_Load(object sender, EventArgs e)
        {
            //this.DialogResult = DialogResult.No;
        }
    }
}
